<?php

namespace app\api\model;

use think\Model;

class ArticleModel extends Model
{
    // 表名
    protected $name = 'article';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;

    // 追加属性
    protected $append = [
        'time_describe',
    ];

    public function getTimeDescribeAttr($value, $data)
    {
        $time = $data['createtime'] ? tranTime($data['createtime']) : '';
        return $time;
    }


    
}
